import request from '@/apis/request.js'

export const postLogin = (data) => {
  return request.post('/adm/login', data)
}
export const getList = () => {
  return request.get('/adm/list')
}
export const postAdd = (data) => {
  return request.post('/adm/add', data)
}
export const postDel = (data) => {
  return request.post('/adm/del', data)
}
export const getById = (data) => {
  return request.get('/adm/getById', { params: data })
}
export const postEdit = (data) => {
  return request.post('/adm/edit', data)
}
export const getCategoryList = (data) => {
  return request.get('/category/list', { params: data })
}
export const getCategoryById = (data) => {
  return request.get('/category/getById', { params: data })
}
export const getCategoryByParentId = (data) => {
  return request.get('/category/getListByParentId', { params: data })
}
export const postCategoryDel = (data) => {
  return request.post('/category/del', data)
}
export const postCategoryAdd = (data) => {
  return request.post('/category/add', data)
}
export const postCategoryEdit = (data) => {
  return request.post('/category/edit', data)
}
export const getArticlePageList = (data) => {
  return request.get('/article/pageList', { params: data })
}
export const postArticleDel = (data) => {
  return request.post('/article/del', data)
}
export const postArticleAdd = (data) => {
  return request.post('/article/add', data)
}
export const getArticleGetById = (data) => {
  return request.get('/article/getById', { params: data })
}
export const postArticleEdit = (data) => {
  return request.post('/article/edit', data)
}
export const getNavByParentId = (data) => {
  return request.get('/nav/getListByParentId', { params: data })
}
export const postNavDel = (data) => {
  return request.post('/nav/del', data)
}
export const postNavAdd = (data) => {
  return request.post('/nav/add', data)
}
export const getNavById = (data) => {
  return request.get('/nav/getById', { params: data })
}
export const postNavEdit = (data) => {
  return request.post('/nav/edit', data)
}
export const getNavTree = () => {
  return request.get('/nav/tree')
}